import { Component, ViewChild, ViewChildren } from '@angular/core';
import { IonicPage, NavController, NavParams, Slides } from 'ionic-angular';

/**
 * Generated class for the DemoSlidesPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-demo-slides',
  templateUrl: 'demo-slides.html',
})
export class DemoSlidesPage {
  //映射#myslider
  @ViewChild('myslider') myslides: Slides;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad DemoSlidesPage');
  }

  go_slider(idx) {
    this.myslides.slideTo(idx, 2000);
  }

  sliderChange() {
    alert('slider to ' + this.myslides.getActiveIndex());
  }



}
